package com.nbsaas.boot.merchant.rest.resource;

import com.nbsaas.boot.merchant.api.apis.MerchantSettlementApi;
import com.nbsaas.boot.merchant.data.entity.MerchantSettlement;
import com.nbsaas.boot.merchant.api.domain.request.MerchantSettlementRequest;
import com.nbsaas.boot.merchant.api.domain.response.MerchantSettlementResponse;
import com.nbsaas.boot.merchant.api.domain.simple.MerchantSettlementSimple;
import com.nbsaas.boot.merchant.rest.convert.MerchantSettlementSimpleConvert;
import com.nbsaas.boot.merchant.rest.convert.MerchantSettlementEntityConvert;
import com.nbsaas.boot.merchant.rest.convert.MerchantSettlementResponseConvert;
import com.nbsaas.boot.merchant.data.repository.MerchantSettlementRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   商家结算-业务接口实现
*/
@Transactional
@Service
public class MerchantSettlementResource extends BaseResource<MerchantSettlement,MerchantSettlementResponse, MerchantSettlementSimple, MerchantSettlementRequest>  implements MerchantSettlementApi {

    @Resource
    private MerchantSettlementRepository merchantSettlementRepository;

    @Override
    public JpaRepositoryImplementation<MerchantSettlement, Serializable> getJpaRepository() {
        return merchantSettlementRepository;
    }

    @Override
    public Function<MerchantSettlement, MerchantSettlementSimple> getConvertSimple() {
        return new MerchantSettlementSimpleConvert();
    }

    @Override
    public Function<MerchantSettlementRequest, MerchantSettlement> getConvertForm() {
        return new MerchantSettlementEntityConvert();
    }

    @Override
    public Function<MerchantSettlement, MerchantSettlementResponse> getConvertResponse() {
        return new MerchantSettlementResponseConvert();
    }




}


